Properly check deleted posts. Fixes #518.