correct issues @thejenix found