Fix keyerror referring to an empty variable on the next line >_>