Bugfixes; Removed unneeded cast to grayscale