Solved bugs in methods addWindow and withWindow from the builder

Change-Id: Id6330b2ecb0cb91de6a6885062ca53378ba87768