Fix problem in cylinder function