Re-order checks in core_sieve

This re-orders the checks in core_sieve so they can all function correctly.

This fixes permission checking not working on commands.