clean up nil attributes and fix path-based loading