some bug fixes for cloner