more bug fixes and some permissions changes