Fixed bugs with blocks