More solid error checks