Fixed some errors occuring in shared environments