access checks and some fixes