SOME bug fixes