Small fixes and added index-file support