Minor bugfixes
Added a simple implementation of memory.