Piperidines from acid-catalysed cyclisations: Pitfalls, solutions and a new ring contraction to pyrrolidines