Replaced appends by inserts. Fixed attr in spec