Minor fixes to avoid circular imports