Merged two improvements from upstream

Ref: https://github.com/rofl0r/hexedit0r/issues/1