Fixed double-run bug and added SBT plugin