Fixed minors bugs.