fix few bugs.