Fix memNeed overflow
Merge pull request #530 from CJentzsch/bugfix

Fix memNeed overflow