Fix some bugs and workflow problems