Add MemoryProtectionError, fix syntax errors