Fix function unloading

lower is a function, not a variable :P
At the moment it's looking if the function object 'lower' is in the case map dictionary, rather than if the lowercase name is.