fix some crashes, refactor old code, add weapon charge widget