I am using Beamer and TikZ for creating some slides, and I am having some problems with positioning nodes. I incrementally display some nodes, and position them using [right of=previousnode]. On the 3rd slide everything still looks fine:

But when I add the next node to the right of the last one, the node is not positioned in the right place:

As you can see it ends up covering some of the previous nodes. Here you have a minimal reproducible example:
EDIT: I have just realized that the part related to displaying/hiding the nodes depending on the slide number, is not related with the covering issue. I added at the end of the question a simplified example where the problem still persists. I am keeping the original example, but you may prefer to directly look at that simplified one.
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shapes, arrows}
\begin{document}
% Keys to support piece-wise uncovering of elements in TikZ pictures:
% \node[visible on=<2->](foo){Foo}
%
% Internally works by setting opacity=0 when invisible, which has the
% adavantage (compared to \node<2->(foo){Foo} that the node is always there, hence
% always consumes space that (foo) is always available.
%
% The actual command that implements the invisibility can be overriden
% by altering the style invisible. For instance \tikzsset{invisible/.style={opacity=0.2}}
% would dim the ``invisible'' parts. Alternatively, the color might be set to white, if the
% output driver does not support transparencies (e.g., PS)
%
% Reference: http://tex.stackexchange.com/a/55849/16933
%
\tikzset{
invisible/.style={opacity=0},
visible on/.style={alt=#1{}{invisible}},
alt/.code args={<#1>#2#3}{%
\alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path
},
}
\tikzstyle{ps.block} = [draw, rectangle, minimum size=1cm, fill=olive!60]
\tikzstyle{ps.pin} = [pin distance=2mm, pin edge={->}]
\tikzstyle{best.ps.block} = [draw, rectangle, minimum width=5cm, minimum height=1cm, fill=olive!60]
\begin{frame}[fragile]{Test Frame}
\begin{block}{Test block}
\begin{itemize}
\item xxx
\item yyy
\end{itemize}
\end{block}
\begin{tikzpicture}
\node [ps.block, pin={[style=ps.pin]above:$IPC_{1}$}] (ps1) {$ps_{1}$};
\node [ps.block, pin={[style=ps.pin]above:$IPC_{2}$}, right of=ps1, visible on=<2->] (ps2) {$ps_{2}$};
\node [ps.block, right of=ps2, visible on=<3->] (psdots) {$\ldots$};
\node [ps.block, pin={[style=ps.pin]above:$IPC_{n}$}, right of=psdots, visible on=<3->] (psn) {$ps_{n}$};
\node [best.ps.block, right of=psn, visible on=<4->] (psbest) {$ps_{best}$};
\end{tikzpicture}
\end{frame}
\end{document}
Does anyone know how to properly fix this problem?
Simplified version:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shapes, arrows}
\begin{document}
\tikzstyle{ps.block} = [draw, rectangle, minimum size=1cm, fill=olive!60]
\tikzstyle{ps.pin} = [pin distance=2mm, pin edge={->}]
\tikzstyle{best.ps.block} = [draw, rectangle, minimum width=3cm, minimum height=1cm, fill=olive!60]
\begin{frame}[fragile]{Test Frame}
\begin{block}{Test block}
\begin{itemize}
\item xxx
\item yyy
\end{itemize}
\end{block}
\begin{tikzpicture}
\node [ps.block, pin={[style=ps.pin]above:$IPC_{1}$}] (ps1) {$ps_{1}$};
\node [ps.block, pin={[style=ps.pin]above:$IPC_{2}$}, right of=ps1] (ps2) {$ps_{2}$};
\node [ps.block, right of=ps2] (psdots) {$\ldots$};
\node [ps.block, pin={[style=ps.pin]above:$IPC_{n}$}, right of=psdots] (psn) {$ps_{n}$};
\node [best.ps.block, right of=psn] (psbest) {$ps_{best}$};
\end{tikzpicture}
\end{frame}
\end{document}
