A few guards to prevent logic errors