fixed bug with scratchpad size check, by Otila