Fixed bugs #1