cloned fixes from https://github.com/balihoo/phockito-unit/pull/4