Bug fixes on lottery