Merging sweetlilmre's changes