Possible fix for #305 and fixed a import