Fix some bugs in my edits, add a spec.