Fix some bugs. Add 'status' command.