Updated code to work with Ubuntu 14.04.