Fixed bugs(?) with help of IDE