fixes for some memory issues in NoPLc