Bug with addition of 'complex objects' to arrays