Added read_only and scratch support