Few bug fixes