Move assert to run-time check