Fixed background flickering issue (fixes #28)