fixed struct access type and added tests for all