Fixes modify_s bugs and custom directory loading issues.

This fixes some issues that are long standing.