fix list index out of range error mentioned in #13
fix KeyError mentioned in #13 ( imported from https://code.google.com/p/rtm-ros-robotics/source/browse/trunk/rtmros_common/openrtm/rtcryo.patch?r=953 )