Few minors bug fixes