Major improvements ordered at Aberdeen and Elgin hospitals