Fix for "black square detection" not working properly