Some minor variable name changes, and got rid of else blocks in cases where if will thrown an UnsupportedOperationException. (i.e. when an enviroment variable that is needed is null)