Fixes for memory size check