memory fixes and fixing core module
Merge pull request #1 from samdmarshall/mergeme

memory fixes and fixing core module