Memcheck

These commits fix two memcheck errors/warnings