Fix AIOOBE.
Fix NPE when pasting an empty buffer

Right-click paste is grayed out when buffer is empty, but middle button
paste is still available
Merge remote-tracking branch 'upstream/master'
Fix a NPE when LANG is not defined (typically on Windows)
Merge pull request #79 from Plonk42/lang_npe

Lang npe