Fix bug in expand and exectuable handling