Fix for MAGN-133
Fix for MAGN-128
Fix out of bounds exception.
Fix for MAGN-19.
Fix for MAGN-134.