Fixed bug 339
Fixed bugs