Various issues, new functions and stuff

#240 #220 #249 #229 #232