Fixes for undefined checks