Small changes from testing installation.

Minor changes to fix installation in linux and speed optimisations.