Exercise can cause muscles to retain water which can show as a gain on the scale. Muscle is also more dense than fat, so if you lose fat and gain a little lean muscle, you will go down in sizes but could technically go up a tiny bit on the scale. You could weigh 150 and be a size 4 (with exercise) or weigh 140 and be a size 6 (without exercise). Just keep going, it will work out.