Fixes to last commit (6ee50d4f514b7c0ecacac978b41d2ea08758d73d)