Corrected a few bugs. PostureTask segfaults in test