Fixed filesystem problem

Also added a quick test