#266 Fixed bugs