Fix improper optional class behavior