Feature/protected attributes assignment

instead of proposed fix #88 - includes tests