Fixes for has_many relationships