Fixed bugs introduced in last commits