Resolved issues occuring when saving both a protocol and a result. Added test case for saveResult.