Added some fixes required by GPL