Screenshot implementation and bug fixes