Function tweaking and new plot tests