Added more memory related checks