Close() methods now return error
Fix cyclic dependency