Fixed some Checkstyle violation and added the autoleave functionality to MainActivity. Not tested for now.