Emit errors when ps is null

Cleaned up #8.