Sometimes passed in id is an empty string instead of nil

In this case it should be handled correctly and doesn't return path/.extension when getting the path string.
This is only broken for singleton classes because other classes "should" have ids.