Fix missing check for invalid initialization