Fix cask
Remove legacy code
Fix custom-file loading