Fixed bug in horizontal check