Enable strict mode

This patch enables strict mode, and fixes the issues raised.