Fixed cage generation bug