There some fixed

Thanks to IDEA for finding strange code.
After looking into history that code seems have bugs =)